﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using GPSTrackingWebsiteManager.Manager.Pages;
using GPSTrackingWebsiteManager.ClassManager;

namespace GPSTrackingWebsiteManager.Pages
{
    public partial class OpenStreetMap : ClassManager.SessionManagerPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        [System.Web.Services.WebMethod]
        public static string wsGetImeiTrackDataLastLocationByUser()
        {
            try
            {
                SessionManager objSessionManager = (SessionManager)HttpContext.Current.Session["SessionManager"];

                //if(objSessionManager != null)
                return new GPSTrackingController.GPSTrackingControllerSoapClient().wsGetImeiTrackDataLastLocationByUser(objSessionManager.CompanyIDSelectedComboBox, HttpContext.Current.User.Identity.Name, objSessionManager.IsUser, objSessionManager.IsAdmin, objSessionManager.IsMaster);
                //else
                //return new GPSTrackingController.GPSTrackingControllerSoapClient().wsGetImeiTrackDataLastLocationByUser(HttpContext.Current.User.Identity.Name, true, false, false);
            }
            catch (Exception e)
            {
                throw e;
            }
        }
        [System.Web.Services.WebMethod]
        public static string wsGetCompanyInfoByCompanyID()
        {
            try
            {
                string CompanyID = string.Empty;

                if (HttpContext.Current.Request.Cookies["CompanyID"] != null) CompanyID = HttpContext.Current.Request.Cookies["CompanyID"].Value;
                if (String.IsNullOrEmpty(CompanyID))
                    CompanyID = "-1";
                return new GPSTrackingController.GPSTrackingControllerSoapClient().wsGetCompanyInfoByCompanyID(int.Parse(CompanyID));
            }
            catch (Exception e)
            {
                throw e;
            }
        }

    }
}